package com.yu.dao;

import java.util.List;

import com.sun.org.apache.bcel.internal.generic.NEW;
import com.yu.pojo.Thuiyuan;

public class ThuiyuanDao {
	public boolean getbyuname(String uname) {
		String sqlString = "select * from thuiyuan where uname = ?";
		List list = DH.getall(sqlString, new Thuiyuan(), new String[] {uname});
		if(list.size()>0) {
			return true;
		}else {
			return false;
		}
	}
	public boolean getbyuphone(String uphone) {
		String sqlString = "select * from thuiyuan where uphone = ?";
		List list = DH.getall(sqlString, new Thuiyuan(), new String[] {uphone});
		if(list.size()>0) {
			return true;
		}else {
			return false;
		}
	}
	public boolean getbyuemail(String uemail) {
		String sqlString = "select * from thuiyuan where uemail = ?";
		List list = DH.getall(sqlString, new Thuiyuan(), new String[] {uemail});
		if(list.size()>0) {
			return true;
		}else {
			return false;
		}
	}
	public Boolean save(String uname, String upwd,String realname, String uphone, String uemail, String xingbie, String uage, String dqid) {
		String sqlString = "insert into thuiyuan(uname,upwd,realname,uphone,uemail,xingbie,uage,dqid) values(?,?,?,?,?,?,?,?)";
		int num = DH.update(sqlString, new String[] {uname,upwd,realname,uphone,uemail,xingbie,uage,dqid});
		if(num>0) {
			return true;
		}else {
			return false;
		}
	}
}
